
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:zhrs/Utils/windowsSize.dart';
import 'package:zhrs/Model/message.dart';
import 'package:zhrs/mainpage/webviewpage.dart';
class recommendation extends StatelessWidget
{

  Function reset;
  recommendation({this.recommendationmessages,this.reset})
  {

  }
  List<recommendationmessage> recommendationmessages;
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return  Container(
      width: windowsSize.mapViewWidth*0.95,
       padding: EdgeInsets.only(top:15,),
      child:Column(
        children:
       <Widget>[
         Row(
            children: <Widget>[
              Container(

               // padding: EdgeInsets.only(top:15),
                child: Text("岗位推荐",style: TextStyle(fontSize: 20),),
              ),
              Container(
                width:  windowsSize.mapViewWidth*0.7,
                //color: Colors.red,
                padding: EdgeInsets.only(left: windowsSize.mapViewWidth*0.55),
                child: Text("更多>",style: TextStyle(fontSize: 15,color: Colors.grey),),
              ),

            ],
          ),
          Container(
            //color: Colors.white,
            padding: EdgeInsets.only(top:10,),
            child: Container
              (
              width: windowsSize. mapViewWidth,
              color: Colors.black12,
              height:1,
            ),
          ),
          Column(
          children: this.recommendationmessages.map((val){

            return

              Container(
                child:new GestureDetector(
                    onTap: ()
                    {


                        if(val.Url!=null)
                        {
                          reset(url:val.Url);
                       //   Navigator.push(context, new MaterialPageRoute(

                         //   builder :(context)=>new Webviewpage(url:val.Url ),
                        //  ));
                        }
                        else
                        {
                          showCupertinoDialogs(context, "建设中,敬请期待...");
                        }


                    },
                    child:Container(
                        padding: EdgeInsets.only(top:15),
                        child: Row(
                          children: <Widget>[
                            Container(
                              height: 80,
                              width: 125,
                              child: new Image.network(//加载网络图片
                                val.imageUrl,
                                // repeat: ImageRepeat.noRepeat,//图片重复方式
                                fit: BoxFit.fill,
                              ),
                            ),
                            Container(
                              // padding: EdgeInsets.only(bottom: 20),
                                height:80 ,
                                child: Column(
                                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                                  crossAxisAlignment:CrossAxisAlignment.start,
                                  children: <Widget>[
                                    Container(
                                     width: windowsSize.mapViewWidth*0.95-125,
                                      padding: EdgeInsets.only(left: 10),
                                      child:Text(val.title),
                                    ),
                                    Container(
                                      padding: EdgeInsets.only(left: 10),
                                     width: windowsSize.mapViewWidth*0.95-125,
                                      child:Text(val.description,style: TextStyle(fontSize: 10,color: Colors.grey),),
                                    ),
                                  ],
                                )
                            ),
                          ],
                        )
                    )) ,
              );

          }).toList(),
          ),
        ],
      ) ,
    );
  }
}